/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lesson10;

import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author netcracker
 */
public class Keeper extends Thread{

    //private IVector vector;
    private OneReadThread ort;
    private OneWriteThread owt;
    private Thread ortThread;
    private Thread owtThread;
    public Keeper(IVector vector) {
        //this.vector = vector;
        ort = new OneReadThread(vector);
        owt = new OneWriteThread(vector);
        ortThread = new Thread(ort);
        owtThread = new Thread(owt);
    }

    @Override
    public synchronized void run() {
            owtThread.start();
            ortThread.start(); 
    }
}